m, n = map(int, input().split())
count, sum = 0, 0
for i in range(m, n + 1):
    if i < 2:
        continue
    flag = True
    for j in range(2, int(i ** 0.5) + 1):
        if i % j == 0:
            flag = False
            break
    if flag:
        sum += i
        count += 1
print(count, sum)